package com.wans.easyuibackend.controller;

import com.wans.easyuibackend.service.ExcelService;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@SuppressWarnings({"all"})
@CrossOrigin
public class ExcelController {

    @Autowired
    private ExcelService excelService;

    @GetMapping("/excel")
    public Object findExcelStaff(HttpServletResponse response) {
        return excelService.findExcelStaff(response);
    }

    @GetMapping("/excel-template")
    public Object findExcelTemplate(HttpServletResponse response) {
        return excelService.findExcelTemplate(response);
    }

    @PostMapping("/excel")
    public Object addExcelStaff(MultipartFile staffInfo) {
        return excelService.addExcelStaff(staffInfo);
    }
}
